<%@ page contentType="text/html;charset=UTF-8" language="java" buffer="100kb" autoFlush="true" %>

<!DOCTYPE html>
<html lang="en">
<head>
    <%@include file="/front-end/views/common/head.jsp"%>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>影片</title>
    <style>
        *{
            margin:0;
            padding:0;
            list-style: none;
            text-decoration: none;
        }
        #head{
            width:100%;
            height:100px;
            background-color: #e5e5e5;
        }
        #head li{
            margin-top: 40px;
            float:left;
            height:39px;
            line-height: 39px;
            padding:0 20px;
            text-align:center;
            cursor:pointer;
            list-style: none;
            font-size: 30px;
        }
        #head img{
            float:left;
            height:100px;
        }
        #main{
            /* background-color: red; */
            width:100%;
            height:1200px;
        }
        .current{
            background-color: #c81623;
            color:#fff;
        }
        .item{
            display:none;
        }
        #lunbotu ul{
            margin:0;
            padding:0;
            position: absolute;
            width:100000px;
        }
        #lunbotu ul li{
            float:left;
        }
        #lunbotu ul li img{
            width:1700px;
            height: 440px;
        }
        ol{
            position: absolute;
            top:380px;
            left:75%;
            z-index:999;
        }
        ol li{
            margin:10px;
            float:left;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background-color: purple;
        }
        .current{
            background-color: red;
        }

        .currentt{
            /* font-size: 300px; */
            color: red;
        }
        #dianying{
            overflow: hidden;
            width:1300px;
            height:900px;
            margin:0 auto;
            /* background-color: green; */
        }
        #dianying ul li{
            float:left;
            padding:20px;
            font-size: 25px;
            cursor: pointer;
        }
        #dianying .itemone,.itemtwo{
            margin:0 auto;
            margin-top: 50px;
            width:1300px;
            height:800px;
            /* background-color: pink; */

        }
        #xian{
            width:100%;
            height:3px;
            float:left;
            margin-top: -20px;
            background-color: rgb(83, 81, 81);
        }
        .ying{
            position: relative;
            overflow: hidden;
            width: 220px;
            height: 300px;
            float:left;
            margin:20px;
            background-color: #e5e5e5;
        }
        .ying #top{
            /* float: left; */
            width: 220px;
            height:240px;
            background-color: red;
        }
        .ying #bottom{
            width: 220px;
            height:6px;
            /* float:left; */
            background-color: pink;
        }
        .ying img{

            width: 220px;
            height:240px;
        }
        .ying input{
            position: absolute;
            z-index:999;
            border: 1px solid #eb002a;
            width: 220px;
            height:60px;
            font-size: 20px;
            background-color: #eb002a;
            color:white;
            cursor: pointer;
        }
        .ying>button{
            position: absolute;
            z-index:999;
            border: 1px solid #eb002a;
            width: 220px;
            height:60px;
            font-size: 20px;
            background-color: #eb002a;
            color:white;
            cursor: pointer;
        }

        #cover{
            position: absolute;
            width: 220px;
            color:white;
            height: 300px;
            background-color:black;
            bottom:-300px;
            opacity: .6;
        }
        #cover p{
            margin:10px;
        }
        .ying:hover #cover{
            height:300px;
            bottom:0;
            transition: all .6s ease;
        }
        #guanying li{
            margin-top: 10px;
            float:left;
            height:39px;
            line-height: 39px;
            padding:0 20px;
            text-align:center;
            cursor:pointer;
            list-style: none;
            font-size: 25px;
        }
        #ccover h1{
            text-align: center;
            line-height: 280px;
            font-size: 50px;

        }
        .yying #top{
            /* float: left; */
            width: 220px;
            height:240px;
            background-color: red;
        }
        .yying #bottom{
            width: 220px;
            height:6px;
            /* float:left; */
            background-color: pink;
        }
        .yying img{

            width: 220px;
            height:240px;
        }
        .yying input{
            /* position: absolute; */
            /* z-index:999; */
            border: 1px solid #eb002a;
            width: 220px;
            height:60px;
            font-size: 20px;
            background-color: #eb002a;
            color:white;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div id="head">
    <img src="front-end/img/logo.png" alt="">
    <ul>
        <li><a href="index.jsp">首页</a></li>
        <li  class="current"><a href="user/indexServlet?action=play">影片</a></li>
        <li><a href="user/indexServlet?action=myOrder">我的订单</a></li>
        <%@include file="/front-end/views/common/login_success_menu.jsp"%>
    </ul>
</div>
<div id="main">
    <div class="item" style="display:block;">
        <div id="dianying">
            <ul class="one" id="ulone">
                <li class="currentt">正在热映</li>
                <li>即将上映</li>
            </ul>
            <div id="xian"></div>
            <!-- 正在热映 -->
            <div class="itemtwo">
                <c:forEach items="${requestScope.page.items}" var="schedule" >
                    <div class="ying">
                        <div id="top">
                                <%--                            <img src="front-end/img/default.jpg" alt="">--%>
                            <img src="${requestScope.plays[schedule.play_id].play_image}" alt="">
                        </div>
                        <div id="bottom">
                            <input type="button" value="选座购票" onclick='location.href=("/ttms/user/indexServlet?action=chooseSeat&sched_id="+${schedule.sched_id})' />
                        </div>
                        <div id="cover">
                            <p>影片名称：${requestScope.plays[schedule.play_id-1].play_name}</p>
                            <p>放映时间：${schedule.sched_time}</p>
                            <p>影片时长：${requestScope.plays[schedule.play_id-1].play_length}</p>
                            <p>影片票价：${requestScope.plays[schedule.play_id-1].play_ticket_price}</p>
                        </div>
                    </div>
                </c:forEach>

            </div>

            <!-- 即将上映 -->
            <div class="itemtwo">

                <div class="ying">
                    <div id="top">
                        <img src="${play.play_image}" alt="">
                    </div>
                    <div id="bottom">
                        <input type="button" value="暂无详情"  />
                    </div>
                    <div id="cover">
                        <p>敬请期待</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</div>
</body>
<script>
    var lis = document.getElementById('head').querySelectorAll('li');
    var items = document.getElementById('main').querySelectorAll('.item');
    for(var i = 0;i<lis.length;i++){
        lis[i].setAttribute('index',i);
        lis[i].onclick = function (){
            for(var i =0;i<lis.length;i++){
                lis[i].className = '';
            }
            this.className = 'current';
            var index = this.getAttribute('index');
            for(var i = 0;i<items.length;i++){
                items[i].style.display = 'none';
            }
            items[index].style.display = 'block';
        }
    }

    var dianying = document.querySelector('#ulone');
    var lili = dianying.querySelectorAll('li');
    var itemtwo = document.querySelectorAll('.itemtwo');
    for(var i = 0;i<lili.length;i++){
        lili[i].setAttribute('index',i);
        lili[i].onclick = function (){
            for(var i =0;i<lili.length;i++){
                lili[i].className = '';
            }
            this.className = 'currentt';
            var index = this.getAttribute('index');
            for(var i = 0;i<itemtwo.length;i++){
                itemtwo[i].style.display = 'none';
            }
            itemtwo[index].style.display = 'block';
        }
    }
</script>
</html>